define(function(require, exports, module) {

    $.each($('.img-s'), function() {
        var w = $(this).width();
        var h = $(this).height();
        console.log('w' + w + 'h' + h);
        if (w > h) $(this).css('width', "100%");
        else $(this).css('height', "100%");
    })

    $('.material-container>li').click(function() {
        $(this).toggleClass('selected');
    })
    $('#select-all').click(function() {
        if ($(this).is(":checked")) {
            $('.material-container>li').addClass('selected');
        } else {
            $('.material-container>li').removeClass('selected');
        }
    })

    var Modal = require('tool/modal');
    $('.show-tips').click(function(e){
        e.stopPropagation();
    })
    $('.move-folder').click(function() {
        Modal.modal({
            title: "移动到",
            content: __inline('tpl/move.html'),
            modalClass: "shadow",
            modalclose: "show",
            btns: ["<div class='btn btn-blue'>确定</div><div class='btn btn-default modal-close'>取消</div>"],
            afterOpen: function($modal) {
                
                $('.modal-body .folder-one .icon-folder-status').click(function(){

				    $(this).toggleClass('status-close');
				    $(this).siblings().filter('.icon-folder-folder-status').toggleClass('folder-open');
				    $(this).siblings().filter('.folder-one').toggleClass('show');
				})
            }

        });

    })

});
